# coding: utf-8

"""
 Copyright 2023 TikTok Pte. Ltd.

 This source code is licensed under the MIT license found in
 the LICENSE file in the root directory of this source tree.
"""


class NumericErrorCodes:
    ERROR_CODE_OK = 0
    ERROR_CODE_PARTIAL_OK = 20001

    ERROR_CODE_INVALID_PARAMS = 40000
    ERROR_CODE_PERMISSION_ERROR = 40001
    ERROR_CODE_PARAM_ERROR = 40002
    ERROR_CODE_FORBIDDEN = 40003
    ERROR_CODE_VERSION_ERROR = 40006
    ERROR_CODE_NOT_EXIST = 40007
    ERROR_CODE_NOT_IMPL = 40008
    ERROR_CODE_UNSUPPORTED_IN_SANDBOX = 40009
    ERROR_CODE_UNSUPPORTED_DOMAIN = 40010
    ERROR_CODE_ID_LIMIT_EXCEED = 40011
    ERROR_CODE_NO_UPDATE = 40012
    ERROR_CODE_SANDBOX_ADV_NOT_EXIST = 40013
    ERROR_CODE_INVALID_CLUSTER = 40014
    ERROR_CODE_BIZ_FC_ERROR = 40016
    ERROR_CODE_DUPLICATED_REQUEST = 40050
    ERROR_CODE_INVALID_API_VERSION = 40051
    ERROR_CODE_ACO_MATERIAL_EXIST = 40052
    ERROR_CODE_VIDEO_ID_INVALID_ERROR = 40053
    ERROR_CODE_INVALID_BATCH_SIZE = 40061
    ERROR_CODE_PII_NOT_HASHED = 40062
    ERROR_CODE_INVALID_PARTNER_NAME = 40063

    ERROR_CODE_REQUEST_TOO_FREQUENT = 40100
    ERROR_CODE_INVALID_PARTNER = 40101
    ERROR_CODE_ACCESS_TOKEN_EXPIRE = 40102
    ERROR_CODE_REFRESH_TOKEN_EXPIRE = 40103
    ERROR_CODE_EMPTY_ACCESS_TOKEN = 40104
    ERROR_CODE_INVALID_ACCESS_TOKEN = 40105
    ERROR_CODE_INVALID_CORE_USER = 40106
    ERROR_CODE_INVALID_REFRESH_TOKEN = 40107
    ERROR_CODE_INVALID_GRANT_TYPE = 40108
    ERROR_CODE_ERROR_AES_DECIPHER = 40109
    ERROR_CODE_AUTH_CODE_ERROR = 40110
    ERROR_CODE_PASSWORD_ERROR = 40112
    ERROR_CODE_APP_FORBIDDEN = 40113
    ERROR_CODE_ADVERTISER_LOGOUT = 40114
    ERROR_CODE_AUTH_TIMESTAMP_EXPIRE = 40115
    ERROR_CODE_AUTH_SIG_ERROR = 40116
    ERROR_CODE_APP_METHOD_FORBIDDEN = 40117
    ERROR_CODE_NOT_IN_WHITELIST = 40118
    ERROR_CODE_NOT_SAME_IDENTITY = 40119
    ERROR_CODE_TIKTOK_USER_NOT_LOGGED_IN = 40120
    ERROR_CODE_NOT_A_TCM_CREATOR = 40121
    ERROR_CODE_TCM_CREATOR_INVALID_COUNTRY = 40122
    ERROR_CODE_DEVELOPER_REJECTED = 40124
    ERROR_CODE_DEVELOPER_NO_PERMISSION = 40125
    ERROR_CODE_GARM_SINGLE_AUTH_FAILED = 40126
    ERROR_CODE_GARM_DOUBLE_AUTH_FAILED = 40127
    ERROR_CODE_GARM_SINGLE_VALIDATE_ERROR = 40128
    ERROR_CODE_GARM_DOUBLE_VALIDATE_ERROR = 40129
    ERROR_CODE_SCOPE_NOT_AUTHORIZED = 40130
    ERROR_CODE_SCOPE_TT_USER_OAUTH_FAILED = 40131
    ERROR_CODE_REQUEST_FREQUENCY_LIMITED = 40132

    ERROR_CODE_INTERFACE_OFFLINE = 41001
    ERROR_CODE_FIELDS_OFFLINE = 41002
    ERROR_CODE_SITE_TO_VIDEO_SERVICE_ERROR = 41013

    ERROR_CODE_GENERAL_TASK_ERROR = 40200
    ERROR_CODE_TASK_NOT_READY = 40201

    ERROR_CODE_WRITE_CONFLICT = 40202

    ERROR_CODE_ADVERTISER_NOT_EXIST = 40300
    ERROR_CODE_ADVERTISER_ROLE_ERROR = 40301
    ERROR_CODE_CUSTOMER_ADVERTISER_NOT_EXIST = 40302
    ERROR_CODE_REQUIRE_LOGIN = 40309

    ERROR_CODE_ROUTE_NOT_FOUND = 40400

    ERROR_CODE_AD_NUMBER_LIMIT = 40502

    ERROR_CODE_RPC_VALIDATION_ERROR = 40700

    ERROR_CODE_SIGNATURE_ERROR = 40900
    ERROR_CODE_VIDEO_TRANSCODING = 40901
    ERROR_CODE_URL_FETCH_TIMEOUT = 40902
    ERROR_CODE_URL_UNAVAILABLE = 40903
    ERROR_CODE_IMAGE_ILLEGAL_CONTENT = 40904
    ERROR_CODE_FILE_NOT_EXIST = 40905
    ERROR_CODE_FILE_EMPTY = 40906
    ERROR_CODE_FILE_TOO_LARGE = 40907
    ERROR_CODE_FILE_TYPE_ERROR = 40908
    ERROR_CODE_FILE_CALCULATE_TYPE_ERROR = 40909
    ERROR_CODE_FILE_EXPIRED = 40910
    ERROR_CODE_DUPLICATED_MATERIAL_NAME = 40911
    ERROR_CODE_IMAGE_UNAVAILABLE = 40912
    ERROR_CODE_IMAGE_FETCH_TIMEOUT = 40913
    ERROR_CODE_URL_FETCH_ERROR = 40914
    ERROR_CODE_FILE_UPLOAD_INVALID = 40915
    ERROR_CODE_VIDEO_ILLEGAL_CONTENT = 40916

    ERROR_CODE_BLOCKED = 41000

    ERROR_CODE_SYS_ERROR = 50000
    ERROR_CODE_SYS_TIMEOUT = 50002

    ERROR_CODE_RPC_ERROR = 51000
    ERROR_CODE_STATISTICS_ERROR = 51001
    ERROR_CODE_BUILD_STONE_ERROR = 51002
    ERROR_CODE_DMP_ERROR = 51003
    ERROR_CODE_LEGO_SERVICE_ERROR = 51004
    ERROR_CODE_SMART_PLAYER_ERROR = 51005
    ERROR_CODE_JUPITER_ERROR = 51006
    ERROR_CODE_OVERTURE_STAT_CENTRAL_ERROR = 51007
    ERROR_CODE_ADVERTISER_ERROR = 51008
    ERROR_CODE_DPA_ERROR = 51009
    ERROR_CODE_INTERNAL_TIME_OUT = 51010
    ERROR_CODE_SEARCH_ERROR = 51011
    ERROR_CODE_PIXEL_ERROR = 51012
    ERROR_CODE_LEGO_SERVICE_SYNC_ERROR = 51014
    ERROR_CODE_GRANTING_SERVICE_ERROR = 51015
    ERROR_CODE_ACCOUNT_ERROR = 51016
    ERROR_CODE_VIDEO_TRANSCODE_SERVICE_ERROR = 51017
    ERROR_CODE_AGENT_SERVICE_ERROR = 51018
    ERROR_CODE_IMAGE_CUT_ERROR = 51019
    ERROR_CODE_ORDER_CENTER_SERVICE_ERROR = 51020
    ERROR_CODE_USER_PASSPORT_SERVICE_ERROR = 51030
    ERROR_CODE_PLATFORM_ACCOUNT_SERVICE_ERROR = 51031
    ERROR_CODE_PLAYABLE_SERVICE_ERROR = 51032
    ERROR_CODE_TOOLBOX_ERROR = 51033
    ERROR_CODE_AD_MACHINE_AUDIT_ZEPHYR = 51034
    ERROR_CODE_SATELLITE_ERROR = 51035
    ERROR_CODE_TETRIS_ERROR = 51036
    ERROR_CODE_ASYNC_TASK_ERROR = 51037
    ERROR_CODE_UNION_TREASURE_BOX_ERROR = 51038
    ERROR_CODE_AUTH_SERVICE_ERROR = 51039
    ERROR_CODE_ADVERTISER_INFO_ERROR = 51040
    ERROR_CODE_AD_GARM_SERVICE_ERROR = 51041
    ERROR_CODE_LEGO_BUSINESS_SERVICE_ERROR = 51042
    ERROR_CODE_CREATIVE_PLATFORM_SERVICE_ERROR = 51043
    ERROR_CODE_DPA_PLATFORM_ERROR = 51044
    ERROR_CODE_AD_FILE_SERVICE_ERROR = 51045
    ERROR_CODE_SIRIUS_SERVICE_ERROR = 51046
    ERROR_CODE_SUBSCRIPTION_ERROR = 51047
    ERROR_CODE_ADS_PREVIEW_ERROR = 51048
    ERROR_CODE_DPA_RENDER_GATEWAY_ERROR = 51049
    ERROR_CODE_MEASUREMENT_STONE_ERROR = 51050
    ERROR_CODE_MANUAL_REVIEW_ERROR = 51051
    ERROR_CODE_OPTIMIZER_ERROR = 51052
    ERROR_CODE_DPA_CATALOG_BUSINESS_ERROR = 51053
    ERROR_CODE_CRM_ERROR = 51054
    ERROR_CODE_GCRM_ERROR = 51055
    ERROR_CODE_ADVERTISER_ACCOUNT_SERVICE_ERROR = 51056
    ERROR_CODE_APP_ERROR = 51057
    ERROR_CODE_POSTER_SERVICE_ERROR = 51058
    ERROR_CODE_CONFIG_SERVICE_ERROR = 51059
    ERROR_CODE_BC_RPC_ERROR = 51060
    ERROR_CODE_BM_SERVICE_ERROR = 51061
    ERROR_CODE_IMAGEX_SERVICE_ERROR = 51062
    ERROR_CODE_SEGMENT_GATEWAY_SERVICE_ERROR = 51063
    ERROR_CODE_ECO_GAME_MANAGER_SERVICE_ERROR = 51064
    ERROR_CODE_TTOP_SERVICE_ERROR = 51065
    ERROR_CODE_SUGGESTION_ENGINE_SERVICE_ERROR = 51066
    ERROR_CODE_VIDEOARCH_SERVICE_ERROR = 51067
    ERROR_CODE_STATISTICS_NEW_ERROR = 51099

    ERROR_CODE_DB_ERROR = 52000
    ERROR_CODE_DB_READ_ERROR = 52001
    ERROR_CODE_DB_WRITE_ERROR = 52002
    ERROR_CODE_DB_PARTITION_ERROR = 52003

    ERROR_CODE_RDS_ERROR = 52100
    ERROR_CODE_RDS_READ_ERROR = 52101
    ERROR_CODE_RDS_WRITE_ERROR = 52102
    ERROR_CODE_RDS_TIMEOUT_ERROR = 52103

    ERROR_CODE_TOS_ERROR = 52201
    ERROR_CODE_TOS_UPLOAD_TIMEOUT = 52202
    ERROR_CODE_TOS_HEAD_OBJECT = 52203
    ERROR_CODE_TOS_PUT_OBJECT = 52204

    ERROR_CODE_DESERIALIZATION_ERROR = 53102
    ERROR_CODE_SERIALIZATION_ERROR = 53103

    ERROR_CODE_MAINTENANCE = 60001
    ERROR_CODE_TOO_MANY_REQUESTS_BL = 61000

    ERROR_CODE_INVALID_BIZ_AUTH_TYPE = 70001

    @classmethod
    def has_value(cls, value):
        return value in cls._value2member_map_
